package com.foton.lotterydomain.strategy.repository;

import com.foton.lotterydomain.strategy.model.aggregates.StrategyRich;
import com.foton.lotterydomain.strategy.model.vo.AwardBriefVO;

import java.util.List;

/**
 * @Author RenPu
 * @Date 2023/11/23 15:07
 * @Version 1.0
 * @Description: 抽奖策略仓储层
 **/
public interface IStrategyRepository {

    /**
     * 根据strategyId（策略编码）获取抽奖策略
     *
     * @param strategyId
     * @return
     */
    StrategyRich queryStrategyRich(Long strategyId);


    /**
     * 根据奖品id获取奖品信息
     *
     * @param awardId
     * @return
     */
    AwardBriefVO queryAwardInfo(String awardId);


    /**
     * 查询库存为0的商品ID值，便于在业务逻辑层对抽到此类商品做处理
     *
     * @param strategyId
     * @return
     */
    List<String> queryNoStockStrategyAwardList(Long strategyId);


    /**
     * 针对策略详情的，商品数量进行扣减，根据策略ID值，奖品ID作为条件扣减
     *
     * @param strategyId
     * @param awardId
     * @return
     */
    boolean deductStock(Long strategyId, String awardId);
}
